package com.ahzx.department.controller;

import com.ahzx.department.domain.Department;
import com.ahzx.department.service.DepartmentService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 归属部门控制层
 * @Author syg
 * @Date 2021/4/30 8:56
 * @Desc To be or not to be,that is a question.
 */
@RestController
@RequestMapping("/department")
public class DepartmentController extends BaseController {

    @Autowired
    private DepartmentService departmentService;

    @GetMapping
    public TableDataInfo list() {
        startPage();
        List<Department> list = departmentService.selectDepartmentList();
        return getDataTable(list);
    }
}
